package com.technology.education.network

import com.technology.education.data.ApiResponse
import com.technology.education.data.ApiResponseAll
import com.technology.education.data.ListModel
import com.technology.education.data.model.*
import okhttp3.MultipartBody
import retrofit2.http.*

/**
 * 作者　: hegaojian
 * 时间　: 2019/12/23
 * 描述　: 网络API
 */
interface ApiService {

    companion object {
        const val SERVER_URL = "http://jyfd.youlankeji.cn:8020"
    }


    /**
     * 推送消息
     */
    @POST("/apiService/member/common/pushTPNS")
    suspend fun pushMessage(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 绑定微信
     * "avatar": "",
     *"nickname": "",
     *"openid": ""
     */
    @POST("/apiService/member/common/bindWechat")
    suspend fun bindWechat(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 校验验证码
     *  "authCode": "",
     * "mobile": ""
     */
    @POST("/apiService/member/common/checkAuthCode")
    suspend fun checkAuthCode(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 教师资质认证
     *  "idCardImage1": "",
    "idCardImage2": "",
    "idCardImage3": "",
    "idCardNo": "",
    "realName": ""
     */
    @POST("/apiService/member/teacher/cert")
    suspend fun certTeacher(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 更换手机号
     *  "authCode": "",
     * "mobile": ""
     */
    @POST("/apiService/member/common/changeMobile")
    suspend fun changeMobile(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 登录
     */
    @POST("/apiService/member/common/login")
    suspend fun login(
        @Body apiLoginReq: HashMap<String, Any?>
    ): ApiResponse<LoginModel>

    /**
     * 获取验证码
     */
    @POST("/apiService/member/common/authCode")
    suspend fun sendCode(@Body apiMobileReq: HashMap<String, Any?>): ApiResponseAll

    /**
     * 手机是否已注册
     */
    @POST("/apiService/member/common/mobileExist")
    suspend fun mobileExist(@Body req: HashMap<String, Any?>): ApiResponse<MobileExitModel>

    /**
     * 修改密码
     * oldPassword
     * password	密码
     */
    @POST("/apiService/member/common/modifyPwd")
    suspend fun modifyPwd(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 完善基本信息
     * "address": "",
    "age": 0,
    "city": "",
    "district": "",
    "name": "",
    "province": ""
     */
    @POST("/apiService/member/common/updateBaseInfo")
    suspend fun updateBaseInfo(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 完善支付信息
     *  "alipayName": "",
    "alipayNo": ""
     */
    @POST("/apiService/member/common/updatePayInfo")
    suspend fun updatePayInfo(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 忘记密码
     *  "authCode": "",
     *   "mobile": "",
     *  "password": ""
     */
    @POST("/apiService/member/common/retrievePwd")
    suspend fun retrievePwd(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 注册
     */
    @POST("/apiService/member/common/register")
    suspend fun register(
        @Body apiRegisterReq: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 意见反馈
     * avatar	头像		false
     *name	姓名
     */
    @POST("/apiService/member/common/updateInfo")
    suspend fun updateInfo(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 意见反馈
     * content	内容		false
     *images	图片数组
     */
    @POST("/apiService/member/common/feedback")
    suspend fun feedBack(
        @Body req: HashMap<String, Any?>
    ): ApiResponseAll

    /**
     * 我的信息
     */
    @POST("/apiService/member/common/info")
    suspend fun userInfo(): ApiResponse<UserInfoModel>

    /**
     * 获取腾讯云登录sign
     */
    @GET("/apiService/member/common/getUserSig")
    suspend fun getUserSig(): ApiResponse<SignCloudModel>

    /**
     * 退出登录
     */
    @POST("/apiService/member/common/logout")
    suspend fun logout(): ApiResponseAll

    /**
     *记录定位信息
     * {
     *  "address": "",
     *  "city": "",
     *  "district": "",
     *  "province": ""
     * }
     */
    @POST("/apiService/member/common/logAccess")
    suspend fun saveLocation(@Body apiAreaReq: HashMap<String, Any?>): ApiResponseAll

    /**
     * 时长记录列表
     *   "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/billDurationList")
    suspend fun billDurationList(@Body req: HashMap<String, Any?>): ApiResponse<DurationRecordModel>

    /**
     * 时长记录列表-教师
     *   "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/teacher/billDurationList")
    suspend fun billDurationListTeacher(@Body req: HashMap<String, Any?>): ApiResponse<DurationRecordModel>

    /**
     * 积分记录列表
     *   "pageNo": 0,
     * "pageSize": 0
     * inOutType 收支类型 1收入 0支出
     */
    @POST("/apiService/member/student/billPointList")
    suspend fun billPointList(@Body req: HashMap<String, Any?>): ApiResponse<DurationRecordModel>

    /**
     * 积分记录列表-教师
     *   "pageNo": 0,
     * "pageSize": 0
     * inOutType 收支类型 1收入 0支出
     */
    @POST("/apiService/member/teacher/billPointList")
    suspend fun billPointListTeacher(@Body req: HashMap<String, Any?>): ApiResponse<DurationRecordModel>

    /**
     * 加入或取消黑名单
     *   "id": "",
     *  "state": "" 1收藏 0取消收藏
     */
    @POST("/apiService/member/student/blackTeacher")
    suspend fun blackTeacher(@Body apiCollectReq: HashMap<String, Any?>): ApiResponseAll

    /**
     * 充值套餐列表
     *   "name": "",
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/chargePackList")
    suspend fun chargePackList(@Body apiBaseNameReq: HashMap<String, Any?>): ApiResponse<List<ChargePackModel>>

    /**
     * 收藏或取消课程
     *    "id": "",
     * "state": "" 1收藏 0取消收藏
     */
    @POST("/apiService/member/student/collectCourseVideo")
    suspend fun collectCourseVideo(@Body apiCollectReq: HashMap<String, Any?>): ApiResponseAll

    /**
     * 收藏或取消教师
     *    "id": "",
     * "state": "" 1收藏 0取消收藏
     */
    @POST("/apiService/member/student/collectTeacher")
    suspend fun collectTeacher(@Body apiCollectReq: HashMap<String, Any?>): ApiResponseAll

    /**
     * 评价标签列表
     */
    @POST("/apiService/member/student/commentTagList")
    suspend fun commentTagList(): ApiResponse<List<String>>

    /**
     * 课程分类
     */
    @POST("/apiService/member/student/courseCateList")
    suspend fun courseCateList(): ApiResponse<List<CourseCategory>>

    /**
     * 课程列表
     *   "cateId2": "",
     *"name": "",
     *"pageNo": 0,
     *"pageSize": 0
     */
    @POST("/apiService/member/student/courseList")
    suspend fun courseList(@Body req: HashMap<String, Any?>): ApiResponse<CollectCourseModel>

    /**
     * 收藏课程列表
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/courseCollectList")
    suspend fun courseCollectList(@Body apiBaseReq: HashMap<String, Any?>): ApiResponse<CollectCourseModel>

    /**
     * 消息列表
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/messageList")
    suspend fun messageList(@Body apiBaseReq: HashMap<String, Any?>): ApiResponse<MessageListModel>

    /**
     * 课程视频详情
     */
    @POST("/apiService/member/student/courseVideoDetail/{id}")
    suspend fun courseVideoDetail(@Path("id") id: String): ApiResponse<CourseVideo>

    /**
     * 课程详情
     */
    @POST("/apiService/member/student/courseDetail/{id}")
    suspend fun courseDetail(@Path("id") id: String): ApiResponse<CourseDetailBean>

    /**
     * 删除订单
     */
    @POST("/apiService/member/student/delTeachOrder/{id}")
    suspend fun delTeachOrder(@Path("id") id: String): ApiResponseAll

    /**
     * 删除订单-教师
     */
    @POST("/apiService/member/teacher/delTeachOrder/{id}")
    suspend fun delTeachOrderTeacher(@Path("id") id: String): ApiResponseAll

    /**
     * 评价订单
     * commentContent	评价内容		false
     * commentResult	评价结果 1非常满意 0不太满意		false
     * commentTags	评价标签列表		false
     * id	订单号
     */
    @POST("/apiService/member/student/commentTeachOrder")
    suspend fun commentTeachOrder(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 删除消息
     * ids 逗号分隔
     */
    @POST("/apiService/member/student/delMsg")
    suspend fun delMsg(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 兑换时长
     * "value": 0
     */
    @POST("/apiService/member/student/exchangeDuration")
    suspend fun exchangeDuration(@Body req: HashMap<String, Any?>): ApiResponse<DurationWithdrawModel>

    /**
     * 兑换时长
     *  "address": "",
     *"city": "",
     *"district": "",
     *"goodsId": "",
     *"name": "",
     *"number": 0,
     *"phone": "",
     *"province": ""
     */
    @POST("/apiService/member/student/exchangePointGoods")
    suspend fun exchangePointGoods(@Body req: HashMap<String, Any?>): ApiResponse<ExchangeGoodsModel>

    /**
     * 兑换规则
     */
    @POST("/apiService/member/student/exchangeRule")
    suspend fun exchangeRule(): ApiResponse<ExchangeRuleModel>

    /**
     * 兑换规则-教师
     */
    @POST("/apiService/member/teacher/exchangeRule")
    suspend fun exchangeRuleTeacher(): ApiResponse<ExchangeRuleModel>

    /**
     * 推广学生充值记录
     *  "memberId": "",
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/myInviteChargeList")
    suspend fun myInviteChargeList(@Body req: HashMap<String, Any?>): ApiResponse<InviteChargeRecordModel>

    /**
     * 我的推广列表
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/myInviteList")
    suspend fun myInviteList(@Body req: HashMap<String, Any?>): ApiResponse<InviteListModel>

    /**
     * 我的推广列表-推广员
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/spreader/myInviteList")
    suspend fun myInviteListSpreader(@Body req: HashMap<String, Any?>): ApiResponse<InviteListModel>

    /**
     * 我的推广列表-教师
     * "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/teacher/myInviteList")
    suspend fun myInviteListTeacher(@Body req: HashMap<String, Any?>): ApiResponse<InviteListModel>

    /**
     * 新消息数量
     */
    @POST("/apiService/member/student/newMgsCount")
    suspend fun newMgsCount(): ApiResponse<Int>

    /**
     * 充值订单支付
     *  "oid": "",
     * "payChannel": "" 支付渠道 1支付宝 2微信
     */
    @POST("/apiService/member/student/payChargeOrder")
    suspend fun payChargeOrder(@Body req: HashMap<String, Any?>): ApiResponse<PayBodyModel>

    @POST("/apiService/member/student/payChargeOrder")
    suspend fun payChargeOrderWx(@Body req: HashMap<String, Any?>): ApiResponse<WXPayBodyModel>

    /**
     * 提交充值订单
     *  "chargePackId": "",
     * "hour": 0
     */
    @POST("/apiService/member/student/placeChargeOrder")
    suspend fun placeChargeOrder(@Body req: HashMap<String, Any?>): ApiResponse<ExchangeGoodsModel>

    /**
     * 发布辅导需求
     *   "question": "",
     * "questionImages": [],
     * "teacherId": ""
     */
    @POST("/apiService/member/student/placeTeachOrder")
    suspend fun placeTeachOrder(@Body req: HashMap<String, Any?>): ApiResponse<ExchangeGoodsModel>

    /**
     * 积分商品列表
     *  "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/pointGoodsList")
    suspend fun pointGoodsList(@Body req: HashMap<String, Any?>): ApiResponse<GoodsListModel>


    /**
     * 积分商品兑换订单详情
     */
    @POST("/apiService/member/student/pointOrderDetail/{id}")
    suspend fun pointOrderDetail(@Path("id") id: String): ApiResponse<GoodsOrderDetailModel>

    /**
     * 积分提现详情
     */
    @POST("/apiService/member/student/pointWithdrawDetail/{id}")
    suspend fun pointWithdrawDetail(@Path("id") id: String): ApiResponse<WithdrawOrderDetailModel>

    /**
     * 余额提现详情-推广员
     */
    @POST("/apiService/member/spreader/withdrawDetail/{id}")
    suspend fun withdrawDetail(@Path("id") id: String): ApiResponse<WithdrawOrderDetailModel>

    /**
     * 催单老师
     */
    @POST("/apiService/member/student/urgeTeachOrder/{id}")
    suspend fun urgeTeachOrder(@Path("id") id: String): ApiResponseAll

    /**
     * 积分提现详情-教师
     */
    @POST("/apiService/member/teacher/pointWithdrawDetail/{id}")
    suspend fun pointWithdrawDetailTeacher(@Path("id") id: String): ApiResponse<WithdrawOrderDetailModel>

    /**
     * 积分提现
     *  value	兑换量		false
     * wechatPayCode	微信收款码
     */
    @POST("/apiService/member/student/pointWithdraw")
    suspend fun pointWithdraw(@Body req: HashMap<String, Any?>): ApiResponse<DurationWithdrawModel>

    /**
     * 积分提现-教师
     *  value	兑换量		false
     * alipayName	支付宝名称		false
     * alipayNo	支付宝账户		false
     * remarks	备注		false
     */
    @POST("/apiService/member/teacher/pointWithdraw")
    suspend fun pointWithdrawTeacher(@Body req: HashMap<String, Any?>): ApiResponse<DurationWithdrawModel>

    /**
     * 时长提现-教师
     *  alipayName	支付宝名称		false
     * alipayNo	支付宝账户		false
     * remarks	备注		false
     * value	兑换量		false
     */
    @POST("/apiService/member/teacher/durationWithdraw")
    suspend fun durationWithdraw(@Body req: HashMap<String, Any?>): ApiResponse<DurationWithdrawModel>

    /**
     * 余额提现-推广员
     *  alipayName	支付宝名称		false
     * alipayNo	支付宝账户		false
     * remarks	备注		false
     * value	兑换量		false
     */
    @POST("/apiService/member/spreader/withdraw")
    suspend fun spreaderWithdraw(@Body req: HashMap<String, Any?>): ApiResponse<DurationWithdrawModel>

    /**
     * 积分提现列表
     *  "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/pointWithdrawList")
    suspend fun pointWithdrawList(@Body req: HashMap<String, Any?>): ApiResponse<WithdrawOrderListModel>

    /**
     * 余额提现列表-推广员
     *  "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/spreader/withdrawList")
    suspend fun withdrawList(@Body req: HashMap<String, Any?>): ApiResponse<WithdrawOrderListModel>

    /**
     * 搜索
     * keyword	关键字
     */
    @POST("/apiService/member/student/search")
    suspend fun search(@Body req: HashMap<String, Any?>): ApiResponse<SearchModel>

    /**
     * 辅导订单详情
     */
    @POST("/apiService/member/student/teachOrderDetail/{id}")
    suspend fun teachOrderDetail(@Path("id") id: String): ApiResponse<TeacherOrderDetailModel>

    /**
     * 辅导订单详情-教师
     */
    @POST("/apiService/member/teacher/teachOrderDetail/{id}")
    suspend fun teachOrderDetailTeacher(@Path("id") id: String): ApiResponse<TeacherOrderDetailModel>


    /**
     * 辅导订单列表
     *  "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/student/teachOrderList")
    suspend fun teachOrderList(@Body req: HashMap<String, Any?>): ApiResponse<TeacherOrderListModel>

    /**
     * 辅导订单列表-教师
     *  "pageNo": 0,
     * "pageSize": 0
     * state	状态 1进行中 2已完成 3待评价 不传返全部
     */
    @POST("/apiService/member/teacher/teachOrderList")
    suspend fun teachOrderListTeacher(@Body req: HashMap<String, Any?>): ApiResponse<TeacherOrderListModel>

    /**
     * 教师黑名单列表
     *  "pageNo": 0,
     * "pageSize": 0
     * name
     */
    @POST("/apiService/member/student/teacherBlackList")
    suspend fun teacherBlackList(@Body req: HashMap<String, Any?>): ApiResponse<TeacherBlackListModel>

    /**
     * 收藏教师列表
     *  "pageNo": 0,
     * "pageSize": 0
     * name
     */
    @POST("/apiService/member/student/teacherCollectList")
    suspend fun teacherCollectList(@Body req: HashMap<String, Any?>): ApiResponse<ListModel<TeacherInfoModel>>

    /**
     * 教师列表
     *  "pageNo": 0,
     * "pageSize": 0
     * name
     */
    @POST("/apiService/member/student/teacherList")
    suspend fun teacherList(@Body req: HashMap<String, Any?>): ApiResponse<ListModel<TeacherInfoModel>>

    /**
     * 已读消息
     * ids
     */
    @POST("/apiService/member/student/viewMsg")
    suspend fun viewMsg(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 教师首页数据
     */
    @POST("/apiService/member/teacher/home")
    suspend fun homeTeacher(): ApiResponse<TeacherHomeModel>

    /**
     * 推广辅导记录
     * memberId	用户Id		false
     * pageNo	页码,示例值(1)		false
     * pageSize	页SIZE,示例值(10)
     */
    @POST("/apiService/member/teacher/myInviteTeachList")
    suspend fun myInviteTeachList(@Body req: HashMap<String, Any?>): ApiResponse<ListModel<InviteTeachModel>>

    /**
     * 获取保证金支付信息
     * oid	订单号		false
     * payChannel	支付渠道 1支付宝 2微信
     */
    @POST("/apiService/member/teacher/payDepositOrder")
    suspend fun payDepositOrder(@Body req: HashMap<String, Any?>): ApiResponse<PayBodyModel>

    @POST("/apiService/member/teacher/payDepositOrder")
    suspend fun payDepositOrderWx(@Body req: HashMap<String, Any?>): ApiResponse<WXPayBodyModel>

    /**
     * 保障金下单
     */
    @POST("/apiService/member/teacher/placeDepositOrder")
    suspend fun placeDepositOrder(): ApiResponse<DurationWithdrawModel>

    /**
     * 待接单列表-教师
     *  "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/teacher/pendingOrderList")
    suspend fun pendingOrderList(@Body req: HashMap<String, Any?>): ApiResponse<ListModel<TeachOrderModel>>

    /**
     * 发起辅导-教师
     *  id
     */
    @POST("/apiService/member/teacher/startOrder")
    suspend fun startOrder(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 更新接单状态-教师
     *  serviceState	0休息 1接单
     */
    @POST("/apiService/member/teacher/updateServiceState")
    suspend fun updateServiceState(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 接单-教师
     *  id
     */
    @POST("/apiService/member/teacher/takeOrder")
    suspend fun takeOrder(@Body req: HashMap<String, Any?>): ApiResponse<ExchangeGoodsModel>

    /**
     * 上传笔记-教师
     *  answer	笔记内容		false
     *answerImages	笔记图片数组		false
     *string
     * id	订单号
     */
    @POST("/apiService/member/teacher/uploadAnswer")
    suspend fun uploadAnswer(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 申请退货保障金-教师
     *  alipayName	支付宝名称		false
     * alipayNo	支付宝账户		false
     * remarks	备注		false
     * value	兑换量
     */
    @POST("/apiService/member/teacher/withdrawDeposit")
    suspend fun withdrawDeposit(@Body req: HashMap<String, Any?>): ApiResponse<DurationWithdrawModel>

    /**
     * 提现记录列表-教师
     *   "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/teacher/withdrawList")
    suspend fun withdrawListTeacher(@Body req: HashMap<String, Any?>): ApiResponse<WithdrawOrderListModel>

    /**
     * 结束辅导-教师
     *   "id": 0,
     */
    @POST("/apiService/member/teacher/endOrder")
    suspend fun endOrder(@Body req: HashMap<String, Any?>): ApiResponseAll

    /**
     * 余额记录-推广员
     *   "pageNo": 0,
     * "pageSize": 0
     */
    @POST("/apiService/member/spreader/billBalanceList")
    suspend fun billBalanceList(@Body req: HashMap<String, Any?>): ApiResponse<DurationRecordModel>

    /**
     * 推广学生充值记录-推广员
     *   "pageNo": 0,
     * "pageSize": 0
     * memberId	用户Id
     */
    @POST("/apiService/member/spreader/myInviteChargeList")
    suspend fun myInviteChargeListSpreader(@Body req: HashMap<String, Any?>): ApiResponse<InviteChargeRecordModel>

    /**
     * 文件上传
     */
    @Multipart
    @POST("/apiService/common/fileUpload")
    suspend fun uploadFile(
        @Part file: List<MultipartBody.Part>
    ): ApiResponse<List<String>>

}